<h2>Add Subject To Volume</h2>
<hr/>
<p>To add a subject to the current volume, enter the subject name into
 the following field and select the submit button.<br />
 To view an existing subject for this volume select the view option.
 To remove a subject from the current volume select the remove option.
</p>
<center>
<table>
<tr>
	<th align="right" width=25%>Accession Number:</th>
	<td><?php echo $volume->access_id; ?></td>
</tr>
<tr>
	<th align="right">Call Number:</th>
	<td><?php echo $volume->call_number; ?></td>
</tr>
<tr>
	<th align="right">Title:</th>
	<td><?php echo $volume->title; ?></td>
</tr>
<tr>
	<th align="right">Publisher Name:</th>
	<td><?php echo $volume->publisher_name; ?></td>
</tr>
<tr>
	<th align="right">Publisher Date:</th>
	<td><?php echo $volume->publisher_date; ?></td>
</tr>
<tr>
	<th align="right">ISBN:</th>
	<td><?php echo $volume->isbn; ?></td>
</tr>
<tr>
	<th align="right">Location ID:</th>
	<td><?php echo $volume->location_id; ?></td>
</tr>
<tr>
	<th align="right">Catalogue Date:</th>
	<td><?php echo $volume->catalogue_date; ?></td>
</tr>
</table>
<br/>
<!-- Subjects belonging to volume -->
<table>
<tr>
	<th width=75%>Subject Name</th>
	<th width=25%>Actions</th>
</tr>
<?php
foreach ($subjects->result() as $subject)
{
	echo '<tr>';
	
	// Details
	echo '<td>' . $subject->subject_name . '</td>';
	
	// Actions
	echo '<td align="center">';
	echo anchor('admin/subject_management/view/' . $subject->subject_id, 'View') . '/' . anchor('admin/catalogue_management/removeSubject/' . $subject->subject_id . '/' . $volume->access_id, 'Remove') . '</br>';
	echo '</td>';
	echo '</tr>';
}
?>
<?php echo form_open('admin/catalogue_management/addSubject/' . $volume->access_id); ?>
<tr>
	<td><?php echo form_input('subject_name', ''); ?></td>
	<td><?php echo form_submit('', 'Submit'); ?></td>
</tr>
</table>
<?php echo form_close(); ?>
<p>
<b><?php echo anchor('admin/catalogue_management/viewVolume/' . $volume->access_id, 'Return to view volume'); ?></b>
</p>
</center>

<script type="text/javascript">
$(document).ready(function() {
	addAutocomplete('[name="subject_name"]', '<?php echo site_url('admin/jquery/autocomplete/tbl_subject/subject_name'); ?>');
});
</script>